import logging

# create logger
logger = logging.getLogger('cli')
logger.setLevel(logging.DEBUG)

# create console handler and set level to debug
ch_client = logging.FileHandler(filename='log.txt', mode='a')
ch_client.setLevel(logging.DEBUG)

# create formatter
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')

# add formatter to ch_client
ch_client.setFormatter(formatter)

# add ch_client to logger
logger.addHandler(ch_client)
